import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import RegisterLogin from '../views/RegisterLogin.vue'
import Welcome from '../views/Welcome.vue'
import AboutUs from '../views/Home/HomeAboutUs.vue'
import AllBlindBox from '../views/Home/HomeAllBlindBox.vue'
import HotBlindBox from '../views/Home/HomeHotBlindBox.vue'
import HomeAdmin from '../views/Admin/AdminHome.vue'
import WelcomeAdmin from '../views/Admin/Welcome.vue'
import AllUserInfo from "../views/Admin/AllUserInfo.vue"
import UserRole from "../views/Admin/UserRole.vue"
import AdminAboutUs from "../views/Admin/HomeAboutUs.vue"
import PlatformBlindBoxQuery from "../views/Admin/PlatformBlindBoxQuery.vue"
import PlatformBlindBoxSaleInfo from "../views/Admin/PlatformBlindBoxSaleInfo.vue"
import ShoppingCart from '../views/Home/ShoppingCart.vue'
import OnTheShelfBlindBox from '../views/Home/OnTheShelfBlindBox.vue'
import MerchantBlindBoxSaleInfo from '../views/Home/MerchantBlindBoxSaleInfo.vue'
import UserInfo from '../views/Home/HomeUserInfo.vue'
import UserWallet from '../views/Home/HomeUserWallet.vue'
import CurrentBalance from '../views/Home/CurrentBalance.vue'
import ConsumptionInfo from '../views/Home/ConsumptionInfo.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    redirect: '/welcome',
    children: [
      {path: '/Welcome',name: 'Welcome',component: Welcome},
      {path: '/AllBlindBox',name: 'AllBlindBox',component: AllBlindBox},
      {path: '/HotBlindBox',name: 'HotBlindBox',component: HotBlindBox},
      {path: '/ShoppingCart',name: 'ShoppingCart',component: ShoppingCart},
      {path: '/OnTheShelfBlindBox',name: 'OnTheShelfBlindBox',component: OnTheShelfBlindBox},
      {path: '/MerchantBlindBoxSaleInfo',name: 'MerchantBlindBoxSaleInfo',component: MerchantBlindBoxSaleInfo},
      {path: '/UserInfo',name: 'UserInfo',component: UserInfo},
      {path: '/UserWallet',name: 'UserWallet',component: UserWallet,children:[
        {path: '/CurrentBalance',name: 'CurrentBalance',component: CurrentBalance},
        {path: '/ConsumptionInfo',name: 'ConsumptionInfo',component: ConsumptionInfo}
      ]},
      {path: '/AboutUs',name: 'AboutUs',component: AboutUs}
    ]
  },
  {
    path: '/RegisterLogin',
    name: 'RegisterLogin',
    component: RegisterLogin
  },
  {
    path: '/HomeAdmin',
    name: 'HomeAdmin',
    component: HomeAdmin,
    redirect: '/WelcomeAdmin',
    children: [
      {path: '/WelcomeAdmin',name: 'WelcomeAdmin',component: WelcomeAdmin},
      {path: '/AllUserInfo',name: 'AllUserInfo',component: AllUserInfo},
      {path: '/UserRole',name: 'UserRole',component: UserRole},
      {path: '/AdminAboutUs',name: 'AdminAboutUs',component: AdminAboutUs},
      {path: '/PlatformBlindBoxQuery',name: 'PlatformBlindBoxQuery',component: PlatformBlindBoxQuery},
      {path: '/PlatformBlindBoxSaleInfo',name: 'PlatformBlindBoxSaleInfo',component: PlatformBlindBoxSaleInfo},
    ]
  },
]

const router = new VueRouter({
  routes
})

export default router
